// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** PCS控制 PCS控制 POST /device/pcs/control */
export async function pcsControllerControlPcs(
  body: API.PcsControlReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/device/pcs/control`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** PCS事件数据 分页获取PCS事件数据 GET /device/pcs/events */
export async function pcsControllerGetPcsPageEvents(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.pcsControllerGetPcsPageEventsParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationEventPageData>(`${apiPrefix}/device/pcs/events`, {
    method: 'GET',
    params: {
      ...params,
      page: undefined,
      ...params['page'],
      search: undefined,
      ...params['search'],
    },
    ...(options || {}),
  });
}

/** PCS设备信息 GET /device/pcs/infos */
export async function pcsControllerGetPcsInfos(options?: { [key: string]: any }) {
  return request<API.DeviceInfo[]>(`${apiPrefix}/device/pcs/infos`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** PCS实时监控数据 PCS实时监控数据 GET /device/pcs/lastdata/${param0} */
export async function pcsControllerGetLastPcsData(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.pcsControllerGetLastPcsDataParams,
  options?: { [key: string]: any },
) {
  const { code: param0, ...queryParams } = params;
  return request<API.PcsPageData>(`${apiPrefix}/device/pcs/lastdata/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 分页查询 分页查询PCS数据 GET /device/pcs/list */
export async function pcsControllerGetPcsPageDatas(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.pcsControllerGetPcsPageDatasParams,
  options?: { [key: string]: any },
) {
  return request<API.Pagination>(`${apiPrefix}/device/pcs/list`, {
    method: 'GET',
    params: {
      ...params,
      page: undefined,
      ...params['page'],
      search: undefined,
      ...params['search'],
    },
    ...(options || {}),
  });
}
